package com.LONE.spring6.tx;

import com.LONE.spring6.tx.config.SpringConfig;
import com.LONE.spring6.tx.controller.BookController;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Project ：learn_spring
 * @File ：TestAnno.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/4/5 21:48
 * @Description ：For study.
 */

public class TestAnno {

    @Test
    public void testTxAllAnnotation() {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringConfig.class);
        BookController accountService = applicationContext.getBean("bookController", BookController.class);
        Integer[] bookIds = {1, 2};
        accountService.checkout(bookIds, 1);
    }
}
